﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sengoku
{
    class BetaPiece : Piece
    {
        private int letterCase; //0 = Lower case, 1 = Upper case
        private Position pos;
        private bool isAlpha = false;

        public BetaPiece(int c)
        {
            letterCase = c;
        }

        public int getCase()
        {
            return letterCase;
        }

        public int getHighOrLow()
        {
            return 1; //1 = high
        }

        public String getLetter()
        {
            if (letterCase == 0)
                return "b";
            else
                return "B";
        }

        public void setPosition(int c, int r)
        {
            pos = new Position(r, c);
        }

        public Position getPosition()
        {
            return pos;
        }

        public Position move()
        {
            while (true)
            {
                Console.WriteLine();
                Console.WriteLine("This piece moves diagonally. Choose a valid destination.");
                Console.Write("Column:  ");
                int c = Int32.Parse(Console.ReadLine());
                Console.Write("Row: ");
                int r = Int32.Parse(Console.ReadLine());

                if ((c == pos.getC() + 1 || c == pos.getC() - 1) && (r == pos.getR() + 1 || r == pos.getR() - 1))
                {
                    Position newPos = new Position(c, r);
                    return newPos;
                }
                else
                    Console.Write("Invalid.");
            }
        }

        public bool getIsAlpha()
        {
            return isAlpha;
        }
    }
}
